﻿using System.Collections.Generic;

namespace Glue.Internals
{
    public class HashSetSilverlight<T> : IHashSet<T>
    {
        private readonly Dictionary<T, object> hashSet = new Dictionary<T, object>();

        public bool Contains(T key)
        {
            return hashSet.ContainsKey(key);
        }

        public void Remove(T key)
        {
            hashSet.Remove(key);
        }

        public void Add(T key)
        {
            if (!hashSet.ContainsKey(key))
                hashSet.Add(key, null);
        }
    }
}
